//
//  BottomShowViewController.swift
//  XMenSwift
//
//  Created by X-MEN on 2021/12/28.
//

import UIKit

class BottomShowViewController: BaseViewController {
    
    var bottomView : BottomShowCustomView?
    var popView : TCCommentsPopView?
    
    
    override func viewDidLoad() {
        super.viewDidLoad()
        self.navigationItem.title = "底部弹窗"
        self.view.backgroundColor = .gray
        let leble = UILabel.init(frame: CGRect(x: 10, y: 40, width: 200, height: 200));
        leble.text = "请点击屏幕"
        leble.textColor = .red
        leble.setThemeBackgroundColors()
        self.view.addSubview(leble)
        
    }
    
    override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
        btnTouch()
    }
    
    func btnTouch() {
        let tempHeight = 240.0;
        self.bottomView = BottomShowCustomView.init(frame: CGRect(x: 0, y: 0, width: self.view.frame.size.width, height: self.view.frame.size.height - tempHeight));
        self.popView = TCCommentsPopView.init(frame: CGRect(x: 0, y: tempHeight, width: self.view.frame.size.width, height: self.view.frame.size.height - tempHeight), commentBack: self.bottomView)
        self.popView?.show(to: self.view)
    }
    
}
